﻿// HSS.ServiceModel.Internal.IMessageInspector.cs
// ----------------------------------------------------------------------------
// Licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.html
// ----------------------------------------------------------------------------
// HighSpeed-Solutions, LLC
// Copyright (c) 2001-2010
// ----------------------------------------------------------------------------
// File:       IMessageInspector.cs
// Author:     HSS\gbanta
// Created:    08/12/2010
// Modified:   12/04/2010
// ----------------------------------------------------------------------------
namespace HSS.ServiceModel.Internal
{
	#region Using Directives
	using System.ServiceModel;
	using System.ServiceModel.Channels;
	#endregion

	#region IMessageInspector
	/// <summary>
	/// An interface a class can implement to inspect channel messages.
	/// </summary>
	internal interface IMessageInspector
	{
		/// <summary>
		/// The method that is called prior to a message being sent.
		/// </summary>
		/// <param name="request">The originating message that can be inspected.</param>
		/// <param name="channel">The channel the message was delivered.</param>
		/// <returns>A state object.</returns>
		object BeforeSendRequest(ref Message request, IClientChannel channel);
		/// <summary>
		/// The method that is called after a message has been received.
		/// </summary>
		/// <param name="reply">The reply message that can be inspected.</param>
		/// <param name="correlationState">Optionally, the state object returned from BeforeSendRequest.</param>
		void AfterReceiveReply(ref Message reply, object correlationState);
	}
	#endregion
}